package com.probiz.estore.common.model.system.base;

import java.io.Serializable;
import com.probiz.estore.core.model.BaseObject;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;

/**
 * AppResource Base Java Bean, base class for the model, mapped directly to database table
 * 
 * Avoid changing this file if not necessary, will be overwritten. 
 *
 */
public class AppResourceTbl extends BaseObject implements Serializable {

    protected Integer resourceId;
	protected String resourceName;
	protected String resourceString;
	protected String resourceDesc;
	protected Short enableDataAuthz;
	protected Short belongTo;
	protected Integer version;

	protected java.util.Set appRoles = new java.util.HashSet();

	/**
	 * Default Empty Constructor for class AppResource
	 */
	public AppResourceTbl () {
		super();
	}
	
	/**
	 * Default Key Fields Constructor for class AppResource
	 */
	public AppResourceTbl (
		 Integer in_resourceId
        ) {
		this.setResourceId(in_resourceId);
    }

	public java.util.Set getAppRoles () {
		return appRoles;
	}	
	
	public void setAppRoles (java.util.Set in_appRoles) {
		this.appRoles = in_appRoles;
	}
    
    

	/**
	 * 	 * @return Integer
     * @hibernate.id column="resourceId" type="java.lang.Integer" generator-class="native"
	 */
	public Integer getResourceId() {
		return this.resourceId;
	}
	
	/**
	 * Set the resourceId
	 */	
	public void setResourceId(Integer aValue) {
		this.resourceId = aValue;
	}	

	/**
	 * 	 * @return String
	 * @hibernate.property column="resourceName" type="java.lang.String" length="256" not-null="true" unique="false"
	 */
	public String getResourceName() {
		return this.resourceName;
	}
	
	/**
	 * Set the resourceName
	 * @spring.validator type="required"
	 */	
	public void setResourceName(String aValue) {
		this.resourceName = aValue;
	}	

	/**
	 * 	 * @return String
	 * @hibernate.property column="resourceString" type="java.lang.String" length="256" not-null="true" unique="false"
	 */
	public String getResourceString() {
		return this.resourceString;
	}
	
	/**
	 * Set the resourceString
	 * @spring.validator type="required"
	 */	
	public void setResourceString(String aValue) {
		this.resourceString = aValue;
	}	

	/**
	 * 	 * @return String
	 * @hibernate.property column="resourceDesc" type="java.lang.String" length="512" not-null="false" unique="false"
	 */
	public String getResourceDesc() {
		return this.resourceDesc;
	}
	
	/**
	 * Set the resourceDesc
	 */	
	public void setResourceDesc(String aValue) {
		this.resourceDesc = aValue;
	}	

	/**
	 * 	 * @return Short
	 * @hibernate.property column="enableDataAuthz" type="java.lang.Short" length="5" not-null="true" unique="false"
	 */
	public Short getEnableDataAuthz() {
		return this.enableDataAuthz;
	}
	
	/**
	 * Set the enableDataAuthz
	 * @spring.validator type="required"
	 */	
	public void setEnableDataAuthz(Short aValue) {
		this.enableDataAuthz = aValue;
	}	

	/**
	 * 0-后台1-前台	 * @return Short
	 * @hibernate.property column="belongTo" type="java.lang.Short" length="5" not-null="true" unique="false"
	 */
	public Short getBelongTo() {
		return this.belongTo;
	}
	
	/**
	 * Set the belongTo
	 * @spring.validator type="required"
	 */	
	public void setBelongTo(Short aValue) {
		this.belongTo = aValue;
	}	

	/**
	 * 	 * @return Integer
	 * @hibernate.property column="version" type="java.lang.Integer" length="10" not-null="true" unique="false"
	 */
	public Integer getVersion() {
		return this.version;
	}
	
	/**
	 * Set the version
	 * @spring.validator type="required"
	 */	
	public void setVersion(Integer aValue) {
		this.version = aValue;
	}	

	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof AppResourceTbl)) {
			return false;
		}
		AppResourceTbl rhs = (AppResourceTbl) object;
		return new EqualsBuilder()
				.append(this.resourceId, rhs.resourceId)
						.append(this.resourceName, rhs.resourceName)
				.append(this.resourceString, rhs.resourceString)
				.append(this.resourceDesc, rhs.resourceDesc)
				.append(this.enableDataAuthz, rhs.enableDataAuthz)
				.append(this.belongTo, rhs.belongTo)
				.append(this.version, rhs.version)
				.isEquals();
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(-82280557, -700257973)
				.append(this.resourceId) 
						.append(this.resourceName) 
				.append(this.resourceString) 
				.append(this.resourceDesc) 
				.append(this.enableDataAuthz) 
				.append(this.belongTo) 
				.append(this.version) 
				.toHashCode();
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this)
				.append("resourceId", this.resourceId) 
						.append("resourceName", this.resourceName) 
				.append("resourceString", this.resourceString) 
				.append("resourceDesc", this.resourceDesc) 
				.append("enableDataAuthz", this.enableDataAuthz) 
				.append("belongTo", this.belongTo) 
				.append("version", this.version) 
				.toString();
	}

	/**
	 * Return the name of the first key column
	 */
	public String getFirstKeyColumnName() {
		return "resourceId";
	}
	/**
	 * Return the Id (pk) of the entity, must be Integer
	 */
	public Integer getId() {
		return resourceId;
	}

}